# Maintainer: team/kde <bribbers@disroot.org>
# Contributor: Bart Ribbers <bribbers@disroot.org>

# The group tag is just to easily find this APKBUILD by some scripts for automation
# group=kde-frameworks
pkgname=kactivities-stats5
pkgver=5.113.0
pkgrel=0
arch="all !armhf" # armhf blocked by qt5-qtdeclarative
pkgdesc="A library for accessing the usage data collected by the activities system"
url="https://community.kde.org/Frameworks"
license="LGPL-2.1-only OR LGPL-3.0-only"
depends_dev="
	boost-dev
	graphviz-dev
	kactivities5-dev
	kconfig5-dev
	qt5-qtdeclarative-dev
	qt5-qttools-dev
	"
makedepends="$depends_dev
	doxygen
	extra-cmake-modules
	qt5-qtbase-dev
	samurai
	"
_repo_url="https://invent.kde.org/plasma/kactivities-stats.git"
source="https://download.kde.org/stable/frameworks/${pkgver%.*}/kactivities-stats-$pkgver.tar.xz"
subpackages="$pkgname-dev $pkgname-doc"
builddir="$srcdir/kactivities-stats-$pkgver"

replaces="kactivities-stats<=5.110.0-r0"

build() {
	cmake -B build -G Ninja \
		-DCMAKE_BUILD_TYPE=RelWithDebInfo \
		-DCMAKE_INSTALL_PREFIX=/usr \
		-DCMAKE_INSTALL_LIBDIR=lib \
		-DBUILD_QCH=ON
	cmake --build build
}

check() {
	ctest --test-dir build --output-on-failure
}

package() {
	DESTDIR="$pkgdir" cmake --install build
}

sha512sums="
03e555aa0189642b67b7d1f84044970fc67bebd2147c7cf85d77d7d0c9509f9f0c9a99a9f2c3b3398aa6bf5763caf59364a66b8e803939db8cab244737445024  kactivities-stats-5.113.0.tar.xz
"
